
/**
 * 瀑布流组件
 */
var leftList = new Array();//左侧集合
var rightList = new Array();//右侧集合
var leftHight = 0, rightHight = 0, itemWidth = 0, maxHeight = 0;
const app = getApp()
Component({
  /**
   * 组件的属性列表
   */
  properties: { },
 
  /**
   * 组件的初始数据
   */
  data: {
    leftList: [],//左侧集合
    rightList: [],//右侧集合
    listData:[],
    reachBottom: true,
    baseUrl:app.globalData.url,
  },

  attached: function () {
      wx.getSystemInfo({
        success: (res) => {
            let percentage = 750 / res.windowWidth;
            let margin = 20 / percentage;
              itemWidth = (res.windowWidth - margin) / 2;
              maxHeight = itemWidth / 0.8
            }
        });
  },

  /**
   * 组件的方法列表
   */
  methods: {
    /**
     * 组件的点击方法
     * @param {*} event 
     */
    itemClick(event) {
      const index = event.target.dataset.index
      //1赋值
      this.setData({
        currentIndex:index
      })
      //2把方法传出去
      this.triggerEvent('tabclick',{index:index},{})
    },

    /**
     * 填充数据
     */
    fillData: function (listData) {   
        this.setData({
            listData:listData
        });
      },
  },
})
